Beacon Chain Spec: Message processing
In the initial validation
store.time >= (attestation_slot + 1) * SECONDS_PER_SLOT
Attestations can only affect the fork choice of subsequent slots.
store.time >= pre_state.genesis_time + block.slot * SECONDS_PER_SLOT
Blocks cannot be in the future. If they are, their consideration must be delayed until the are in the past.
In the Beacon state transition
attestation_slot + MIN_ATTESTATION_INCLUSION_DELAY <= state.slot <= attestation_slot + SLOTS_PER_EPOCH
data.target.epoch in (get_previous_epoch(state), get_current_epoch(state))
Also, the source epoch must be the justified checkpoint in the current or previous checkpoint
block.slot == state.slot
※Attestation does not have slot field
This enforce all attestations must vote for the correct checkpoint (the epoch boundary block in this slot)
In LMD GHOST, "latest" is defined by the target epoch nrryuya.icon > Is this consistent to the crosslink field?
If there are skip slots, the block root of the slot is the one of the latest block
See process_slots and process_slot
code: Python
def process_slots(state: BeaconState, slot: Slot) -> None:
assert state.slot <= slot
while state.slot < slot:
process_slot(state)
# Process epoch on the start slot of the next epoch
if (state.slot + 1) % SLOTS_PER_EPOCH == 0:
process_epoch(state)
state.slot += Slot(1)
nrryuya.icon > state.slot is the previous slot in state_transition?